package com.kurumi.medical.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kurumi.medical.component.MyConfig;
import com.kurumi.medical.log.ExceptionLog;
import com.kurumi.medical.service.LogService;
@Service
public class LogServiceImpl implements LogService {

	@Autowired
	private MyConfig myConfig;
	
	@Override
	public void write(ExceptionLog exceptionLog) {
		if(exceptionLog.getLogFilePath() == null){
			exceptionLog.setLogFilePath(myConfig.getLogPath());
		}
		
		exceptionLog.writeLog();
	}

	@Override
	public void writeCMIDPdfToImage(ExceptionLog exceptionLog, String logPath) {
		if (null != exceptionLog) {
			exceptionLog.setLogFilePath(logPath);
			exceptionLog.writeLog();
		}
		
	}
	
	

}
